#ifdef __BORLANDC__


#include"graphic2.h"

extern  StrucMesh2  mesh2;
double x00=0.5,y00=0.5,koe=1.;

void gp(double x,double y)
{  int xx,yy;
   y=1.0-y;
   xx=( x00+(x-x00)*koe )*HOR*300;  yy=( y00+(y-y00)*koe )*VERT*300;
   setcolor( COLOR_POINT );
   circle(xx,yy,2);  return;
};

void gp_e(double x,double y)
{  int xx,yy;
   y=1.0-y;
   setcolor( COLOR_EDGE+11 );
   xx=( x00+(x-x00)*koe )*HOR*300;  yy=( y00+(y-y00)*koe )*VERT*300;;
   circle(xx,yy,2);  return;
};

void qwad(double x,double y,double s)
{  int xx,yy,ss;
   y=1.0-y;
   xx=( x00+(x-x00)*koe )*HOR*300;  yy=( y00+(y-y00)*koe )*VERT*300;
   ss=(int)floor(koe*300*s);
   setcolor(COLOR_TREE);
   line(xx,yy-VERT*ss,xx,yy+VERT*ss);
   line(xx-HOR*ss,yy,xx+HOR*ss,yy);
   return;
};

void re_po(double x,double y)
{  int xx,yy;
   y=1.0-y;
   xx=( x00+(x-x00)*koe )*HOR*300;  yy=( y00+(y-y00)*koe )*VERT*300;;
   setcolor(COLOR_BK);  circle(xx,yy,2);
   return;
};

void re_quad(double x,double y,double s)
{  int xx,yy,ss;
   y=1.0-y;
   xx=( x00+(x-x00)*koe )*HOR*300;  yy=( y00+(y-y00)*koe )*VERT*300;;
   ss=(int)floor(koe*300*s);
   setcolor(COLOR_BK);
   line(xx,yy-VERT*ss,xx,yy+VERT*ss);line(xx-HOR*ss,yy,xx+HOR*ss,yy);
   return;
};


void gtr( int v1, int v2, int v3, int n )
{  int x1,x2,x3,y1,y2,y3;
   double dy1,dy2,dy3;

   if(n) setcolor(n);
   else setcolor(COLOR_TR);
       dy1=mesh2.y[v1];  dy2=mesh2.y[v2];  dy3=mesh2.y[v3];
       dy1=1.0-dy1;  dy2=1.0-dy2;  dy3=1.0-dy3;
       x1=( x00+(mesh2.x[v1]-x00)*koe )*HOR*300;    y1=( y00+(dy1-y00)*koe )*VERT*300;
       x2=( x00+(mesh2.x[v2]-x00)*koe )*HOR*300;    y2=( y00+(dy2-y00)*koe )*VERT*300;
       x3=( x00+(mesh2.x[v3]-x00)*koe )*HOR*300;    y3=( y00+(dy3-y00)*koe )*VERT*300;
   line(x1,y1,x2,y2);line(x1,y1,x3,y3);line(x2,y2,x3,y3);
   return;
}/*gtr*/


void show_mesh_tr( double x0, double y0, double koe )
{  int p1,p2,p3,i,x1,x2,x3,y1,y2,y3;
   double dy1,dy2,dy3;
   cleardevice();    setcolor(COLOR_TR);
   for(i=0;i<mesh2.nTria;i++){
      p1=*(mesh2.v1+i);   p2=*(mesh2.v2+i);   p3=*(mesh2.v3+i);
      dy1=*(mesh2.y+p1);  dy2=*(mesh2.y+p2);  dy3=*(mesh2.y+p3);
      dy1=1.0-dy1;  dy2=1.0-dy2;  dy3=1.0-dy3;
      x1=( x0+(*(mesh2.x+p1)-x0)*koe )*HOR*300;   y1=( y0+(dy1-y0)*koe )*VERT*300;
      x2=( x0+(*(mesh2.x+p2)-x0)*koe )*HOR*300;   y2=( y0+(dy2-y0)*koe )*VERT*300;
      x3=( x0+(*(mesh2.x+p3)-x0)*koe )*HOR*300;   y3=( y0+(dy3-y0)*koe )*VERT*300;
      line(x2,y2,x1,y1);line(x2,y2,x3,y3);line(x1,y1,x3,y3);
   }
   return;
}; /* show_mesh_tr */

#else
void empty_ndp(void){
   int i;
   i=0;
   return;
}
#endif
